﻿using Transformable_Engine_v2.Engine.Network;
using Transformable_Engine_v2.Engine.Network.Object;

namespace AngryManagementMayhem.Controller.NetworkObject
{
    public class SearchGame
    {
        public const int ID = 0;

        public NetworkSerializableObject ToNetworkObject()
        {
            return new NetworkSerializableObject(Serialization.Serialize(this), ID);
        }

        public override string ToString()
        {
            return "Search game request";
        }
    }

    public class SearchGameResponse
    {
        public const int ID = 1;

        public string GameName { get; set; }
        public GameController.GameMode GameMode { get; set; }
        public GameController.MapList GameMap { get; set; }
        public int GamePlayers { get; set; }
        public int GameMaxPlayers { get; set; }

        public NetworkSerializableObject ToNetworkObject()
        {
            return new NetworkSerializableObject(Serialization.Serialize(this), ID);
        }

        public override string ToString()
        {
            return string.Format("[Hosted Game] Name: {0} Mode: {1} Map: {2} Players: {3}/{4}", GameName, GameMode, GameMap, GamePlayers, GameMaxPlayers);
        }
    }
}